<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>新品有戏商家管理后台登录</title>
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/layer/layer.js"></script>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.4 -->
    <link href="__STATIC__/login/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="__STATIC__/login/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="__STATIC__/login/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="__STATIC__/login/css/blue.css" rel="stylesheet" type="text/css" />
    <link href="__STATIC__/login/css/family.css" rel="stylesheet" type="text/css" />
</head>
<body class="login-page">
<div class="login-box">
    <div class="login-logo">
        <a href="javascript:0"><b>商家登录登陆</b></a>
    </div><!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg" style="color: red" id="info"></p>
        <form action="" method="post" id="check" onsubmit="return false">
            <div class="form-group has-feedback">
                <input type="text" class="form-control" placeholder="Email" id="account" name="account"/>
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" class="form-control" placeholder="Password" id="password" name="password"/>
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">
                <div class="col-xs-6">
                    <div class="form-group has-feedback" style="width:140px;">
                        <input type="text" class="form-control" placeholder="code" id="code" name="code"/>
                        <span class="glyphicon glyphicon-th form-control-feedback"></span>
                    </div>
                </div>
                <div class="col-xs-6">
                    <img id='imgs' src="{:url('index/index/businesscode')}" onclick="this.src='{:url(\'index/index/businesscode\')}?id='+Math.random()" width="100" height="34"/>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-8" style="width: 100px">

                </div><!-- /.col -->
                <div class="col-xs-4">
                    <button type="submit" id="sub" class="btn btn-primary btn-block btn-flat">登 陆</button>
                </div><!-- /.col -->
            </div>
        </form>
    </div><!-- /.login-box-body -->
</div><!-- /.login-box -->
<script>
    $("#sub").click(function () {
        if(!$("#account").val()){
            $("#info").html('账号不能为空');
            return;
        }
        if(!$("#password").val()){
            $("#info").html('密码不能为空');
            return;
        }
        if(!$("#code").val()){
            $("#info").html('验证码不能为空');
            return;
        }
        $.ajax({
            url:"{:url('index/index/businesslogin')}",
            type:"post",
            data:$("#check").serialize(),
            dataType:"json",
            success:function (res) {
                if(res.success){

                }
                if(res.error){
                    $("#info").html(res.error);
                    $("#imgs")[0].click();
                }
            }
        });
    });
</script>
</body>
</html>
